<script setup>
import { ref } from 'vue'
import SearchPro from '@/components/SearchPro/index.vue'
// 在开发环境中使用本地组件，在生产环境中使用以下导入：
//import SearchPro from '@cimom/ci-web-plugins-commom/SearchPro'
//import '@cimom/ci-web-plugins-commom/dist/CI.Web.Plugins.Commom.css'
const searchProRef1 = ref(null)
const searchProRef2 = ref(null)
const searchProRef3 = ref(null)
function showSearchProFn1(){

  if(searchProRef1.value){
    let params ={
        cleanCache:true,//测试清空缓存
        tableId: 317553293897797,// CID 高级搜索列表的CID 唯一标识
        CPARENT: "cfac7a73-983b-2052-4514-641e9150db4d",// 组别ID
        closeAfterSearchPro:true,// 搜索后是否关闭 true/false
    }
    searchProRef1.value.openDrawer(params)
  }
}
function showSearchProFn2(){

  if(searchProRef2.value){
    let params ={
        cleanCache:true,//测试清空缓存
        tableId: 318160499277893,// CID 高级搜索列表的CID 唯一标识
        CPARENT: "9a212e09-cea4-e8d0-6704-12756aface7b",// 组别ID
        closeAfterSearchPro:true,// 搜索后是否关闭 true/false
    }
    searchProRef2.value.openDrawer(params)
  }
}
function showSearchProFn3(){

  // if(searchProRef3.value){
  //   let params ={
  //       cleanCache:true,//测试清空缓存
  //       tableId: 318232997920837,// CID 高级搜索列表的CID 唯一标识
  //       CPARENT: "45739548-e80e-8713-7206-d67f205ef213",// 组别ID
  //       closeAfterSearchPro:true,// 搜索后是否关闭 true/false
  //   }
  //   searchProRef3.value.openDrawer(params)
  // }
}
function handleQueryFunc1(data){
  console.log('高级查询回调1：',data)
}
function handleQueryFunc2(data){
  console.log('高级查询回调2：',data)
}
function handleQueryFunc3(data){
  console.log('高级查询回调3：',data)
}
</script>

<template>
  <div class="p-4">
    <el-button type="primary" @click="showSearchProFn1()">打开高级查询抽屉-普通类型</el-button>
    <SearchPro ref="searchProRef1" @queryFunc="handleQueryFunc1"/>
  </div>
  <div class="p-4">
    <el-button type="primary" @click="showSearchProFn2()">打开高级查询抽屉-多条件类型</el-button>
    <SearchPro ref="searchProRef2" @queryFunc="handleQueryFunc2"/>
  </div>
  <div class="p-4">
    <el-button type="primary" @click="showSearchProFn3()">打开高级查询抽屉-测试3</el-button>
    <SearchPro :config="{
        cleanCache:true,
        tableId: 318232997920837,
        CPARENT: '45739548-e80e-8713-7206-d67f205ef213',
        closeAfterSearchPro:true
    }" type="tabs" @queryFunc="handleQueryFunc3"/>
  </div>
   
</template>

<style scoped>
</style>
